<?php

/**
 * Created by PhpStorm.
 * User: evan
 * Date: 2017/7/21
 * Time: 上午9:41
 */
class Report extends MY_Admin_Controller
{
    public function index()
    {
        $page = intval($this->input->get_post('page'));
        $page = $page ? $page : 1;

        $limit = 20;
        $offset = ($page-1) * $limit;


        $this->load->model('user/Model_user_report','ur');
        $total = $this->ur->count();
        $data  = $this->ur->lists($offset, $limit);

        //分页
        $this->load->library('pagination');

        $config['total_rows'] = $total;
        $config['per_page'] = $limit;
        $config['base_url'] = '/user/Report/index';

        $this->pagination->initialize($config);
        $show_page = $this->pagination->create_links();


        $data = array
        (
            'data'       => $data,
            'show_page'  => $show_page,
            'total_rows' => $config['total_rows'],
        );

        $this->load->view('admin/user/report/index',$data);
    }
}